<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
		<title>开封市电动自行车头盔佩戴专项整治数据</title>
		<link rel="stylesheet" type="text/css" href="css/app.css" />
	</head>
	<body>

		<div class="bg1">
			<div class="box">
				<div class="section">文明劝导次数：</div>
				<div class="row2">
					<div id="title" class="list_title">第一大队 </div>
					<div id="counts1" class="list_subTitle">0次 </div>
				</div>
				<div class="row2">
					<div id="title" class="list_title">第二大队 </div>
					<div id="counts2" class="list_subTitle">0次 </div>
				</div>
				<div class="row2">
					<div id="title" class="list_title">第三大队 </div>
					<div id="counts3" class="list_subTitle">0次 </div>
				</div>
				<div class="row2">
					<div id="title" class="list_title">第四大队 </div>
					<div id="counts4" class="list_subTitle">0次 </div>
				</div>
				<div class="row2">
					<div id="title" class="list_title">第五大队 </div>
					<div id="counts5" class="list_subTitle">0次 </div>
				</div>
				<div class="row2">
					<div id="title" class="list_title">祥符区大队 </div>
					<div id="counts6" class="list_subTitle">0次 </div>
				</div>
				<div class="row2">
					<div id="title" class="list_title">第七大队 </div>
					<div id="counts7" class="list_subTitle">0次 </div>
				</div>
				<div class="row2">
					<div id="title" class="list_title">杞县大队 </div>
					<div id="counts8" class="list_subTitle">0次 </div>
				</div>
				<div class="row2">
					<div id="title" class="list_title">尉氏大队 </div>
					<div id="counts9" class="list_subTitle">0次 </div>
				</div>
				<div class="row2">
					<div id="title" class="list_title">兰考大队 </div>
					<div id="counts10" class="list_subTitle">0次 </div>
				</div>
				<div class="row2">
					<div id="title" class="list_title">通许大队 </div>
					<div id="counts11" class="list_subTitle">0次 </div>
				</div>
				<div class="row2">
					<div id="title" class="list_title">第六大队 </div>
					<div id="counts66" class="list_subTitle">0次 </div>
				</div>
			</div>

			<div class="box" style="margin-top: 20px;">
				<div class="section">租借头盔次数：</div>
				<div class="row2">
					<div id="title" class="list_title">第一大队 </div>
					<div id="count1" class="list_subTitle">0次 </div>
				</div>
				<div class="row2">
					<div id="title" class="list_title">第二大队 </div>
					<div id="count2" class="list_subTitle">0次 </div>
				</div>
				<div class="row2">
					<div id="title" class="list_title">第三大队 </div>
					<div id="count3" class="list_subTitle">0次 </div>
				</div>
				<div class="row2">
					<div id="title" class="list_title">第四大队 </div>
					<div id="count4" class="list_subTitle">0次 </div>
				</div>
				<div class="row2">
					<div id="title" class="list_title">第五大队 </div>
					<div id="count5" class="list_subTitle">0次 </div>
				</div>
				<div class="row2">
					<div id="title" class="list_title">祥符区大队 </div>
					<div id="count6" class="list_subTitle">0次 </div>
				</div>
				<div class="row2">
					<div id="title" class="list_title">第七大队 </div>
					<div id="count7" class="list_subTitle">0次 </div>
				</div>
				<div class="row2">
					<div id="title" class="list_title">杞县大队 </div>
					<div id="count8" class="list_subTitle">0次 </div>
				</div>
				<div class="row2">
					<div id="title" class="list_title">尉氏大队 </div>
					<div id="count9" class="list_subTitle">0次 </div>
				</div>
				<div class="row2">
					<div id="title" class="list_title">兰考大队 </div>
					<div id="count10" class="list_subTitle">0次 </div>
				</div>
				<div class="row2">
					<div id="title" class="list_title">通许大队 </div>
					<div id="count11" class="list_subTitle">0次 </div>
				</div>
				<div class="row2">
					<div id="title" class="list_title">第六大队 </div>
					<div id="count66" class="list_subTitle">0次 </div>
				</div>
			</div>

		</div>

	</body>
	<script src="js/jquery-3.5.1.min.js"></script>
	<script>
	
	
		// function fun() {
		// 	this.policeMessageCount()
		// 	this.policeHelmetCount()
		// }
		// //间隔1000ms周期性调用函数fun
		// setInterval("fun()", 1000);

		window.onload = function() {
			this.policeMessageCount()
			this.policeHelmetCount()
		}

		function policeMessageCount() {
			$.ajax({
				type: 'POST',
				url: "https://mini.tangdoush.com/api/police/policeMessageCount",
				contentType: 'application/json',
				async: true,
				dataType: 'JSON',
				contentType: 'application/x-www-form-urlencoded;charset=utf-8',
				data: {},
				success: function(res) {
					console.log(res.data)
					for (var item of res.data) {
						if (item.police_id == 1) {
							$("#counts1").html(item.counts + '次')
						} else if (item.police_id == 2) {
							$("#counts2").html(item.counts + '次')
						} else if (item.police_id == 3) {
							$("#counts3").html(item.counts + '次')
						} else if (item.police_id == 4) {
							$("#counts4").html(item.counts + '次')
						} else if (item.police_id == 5) {
							$("#counts5").html(item.counts + '次')
						} else if (item.police_id == 6) {
							$("#counts6").html(item.counts + '次')
						} else if (item.police_id == 7) {
							$("#counts7").html(item.counts + '次')
						} else if (item.police_id == 8) {
							$("#counts8").html(item.counts + '次')
						} else if (item.police_id == 9) {
							$("#counts9").html(item.counts + '次')
						} else if (item.police_id == 10) {
							$("#counts10").html(item.counts + '次')
						} else if (item.police_id == 11) {
							$("#counts11").html(item.counts + '次')
						} else if (item.police_id == 66) {
							$("#counts66").html(item.counts + '次')
						}
					}
				}
			});
		}

		function policeHelmetCount() {
			$.ajax({
				type: 'POST',
				url: "https://mini.tangdoush.com/api/police/policeHelmetCount",
				contentType: 'application/json',
				async: true,
				dataType: 'JSON',
				contentType: 'application/x-www-form-urlencoded;charset=utf-8',
				data: {},
				success: function(res) {
					console.log(res)
					for (var item of res.data) {
						if (item.police_id == 1) {
							$("#count1").html(item.counts + '次')
						} else if (item.police_id == 2) {
							$("#count2").html(item.counts + '次')
						} else if (item.police_id == 3) {
							$("#count3").html(item.counts + '次')
						} else if (item.police_id == 4) {
							$("#count4").html(item.counts + '次')
						} else if (item.police_id == 5) {
							$("#count5").html(item.counts + '次')
						} else if (item.police_id == 6) {
							$("#count6").html(item.counts + '次')
						} else if (item.police_id == 7) {
							$("#count7").html(item.counts + '次')
						} else if (item.police_id == 8) {
							$("#count8").html(item.counts + '次')
						} else if (item.police_id == 9) {
							$("#count9").html(item.counts + '次')
						} else if (item.police_id == 10) {
							$("#count10").html(item.counts + '次')
						} else if (item.police_id == 11) {
							$("#count11").html(item.counts + '次')
						} else if (item.police_id == 66) {
							$("#count66").html(item.counts + '次')
						}
					}
				}
			});
		}
	</script>

</html>
